<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>File Import</title>
</head>
<body bgcolor="#99CCFF">
	<f:view>

		<center>
			<h:form>
				<h:panelGrid columns="4">
					<h:commandButton type="submit" value="Home"
						action="userMainMenu" />
					<h:commandButton type="submit" value="Logout"
						action="logout?faces-redirect=true" />
				</h:panelGrid>
			</h:form>
		</center>

		<br />
		<hr />
		<br />

		<h:form enctype="multipart/form-data">

			<h:panelGrid columns="2"
				style="background-color: Beige; border-bottom-style: solid; border-top-style: solid; border-left-style: solid; border-right-style: solid">

				<h:outputText value="select file to upload:" />
				<t:inputFileUpload id="fileUpload" title="File to upload" 
					storage="default" value="#{actionBeanFile.uploadedFile}" size="60"
					required="true" />


				<h:outputText value="file label:" />
				<h:inputText id="fileLabel" value="#{actionBeanFile.fileLabel}"
					size="60" required="true" requiredMessage="Enter file label" />

				<h:outputText value=" " />
				<h:commandButton id="upload"
					action="#{actionBeanFile.processFileUpload}" value="Submit" />

				<h:outputText value=" " />
				<h:message showSummary="true" showDetail="false" for="fileLabel" />

				<h:outputText value=" " />
				<h:message showSummary="true" showDetail="false" for="fileUpload" />
				
				<h:outputText value=" " />
				<h:outputText rendered="#{messageBean.errorMessage}" value="#{messageBean.message}" />

			</h:panelGrid>
			
		</h:form>

	</f:view>
</body>
</html>